package com.dsg.controller.system;


import com.dsg.controller.base.BaseController;
import com.dsg.service.system.IDsgSysFileService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

/**
 * <p>
 * 系统文件存储表 前端控制器
 * </p>
 *
 * @author system
 * @since 2020-07-11
 */
@Slf4j
@RestController
@RequestMapping("/system/dsgSysFile")
@Api(description = "系统文件存储表")
public class DsgSysFileController extends BaseController {

    @Autowired
    private IDsgSysFileService service;

    /**
     * 下載模板文件
     * @param response
     * @param fileName
     * @throws Exception
     */
    @GetMapping(value = "/downloadTemplateFile")
    public void downloadTemplateFile(HttpServletResponse response,
                         @ApiParam(value = "文件名稱", name = "fileName", required = true) @RequestParam String fileName) throws Exception {
        service.downloadTemplateFile(fileName, response);
    }
}
